#include<iostream>
#include<string>
using namespace std;
bool check(string s)
{
	if (s[0] >= '0' && s[0] <= '9')
	{
		return false;
	}
	for (int j = 0; j < s.length(); j++)
	{
		if (!(s[j] == '_' || s[j] <= '9' && s[j] >= '0' || s[j] >= 'a' && s[j] <= 'z' || s[j] >= 'A' && s[j] <= 'Z'))
		{
			return false;
		}
	}
	return true;
}
int main(){
    int m;
    cin>>m;
    cin.ignore();
    for (int i = 0; i < m; i++)
    {
        string s;
        getline(cin,s);
        if(check(s)){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }
    }
    
}